require('Particles')
require('Shaders')

Swirly = {}
Swirly.__index = Swirly

function Swirly.load(x,y)
	
	local swirly = {}
	setmetatable(swirly, Swirly)
	swirly.x = x
	swirly.y = y
	swirly.pixelEffect = love.graphics.newPixelEffect((Shaders.getNoEffect()):format(#swirly))
	swirly.particleSys = Particles.getObjectParticleSys(0,0)
	swirly.particleSys:start()
	return swirly
	
end

function Swirly:update(dt)

	self.particleSys:update(dt)
	
end

function Swirly:draw()

	love.graphics.setColorMode("modulate")
	love.graphics.setBlendMode("additive")
	love.graphics.draw(self.particleSys, self.x, self.y)
			
end

function Swirly:startRotate()

	self.particleSys:setTangentialAcceleration(2000)
		
end

function Swirly:stopRotate()

	self.particleSys:setTangentialAcceleration(0)
		
end